package com.jsu.clubmanagementsystem.model.vo.review;

import com.jsu.clubmanagementsystem.model.enums.ApplicationTypeEnum;
import lombok.Data;

import java.io.Serializable;

@Data
public class ErrorReviewVO implements Serializable {

    private Long applicationId;

    private String applicationType;

    private static final long serialVersionUID = 1L;

    public static ErrorReviewVO objToVo(Long applicationId, Integer applicationType) {
        ErrorReviewVO errorReviewVO = new ErrorReviewVO();
        errorReviewVO.setApplicationId(applicationId);
        ApplicationTypeEnum applicationTypeEnum = ApplicationTypeEnum.getByCode(applicationType);
        if (applicationTypeEnum != null) {
            errorReviewVO.setApplicationType(applicationTypeEnum.getDescription());
        }
        return errorReviewVO;
    }
}
